Following through with plan announced Feb 28, 2022.
This was a serial unit from the turn of the century. Holux is out of business.
We've done nothing but mechanical maintenance on this format for years.
Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>
globalsat_sport.cc
gtm.cc
gtrnctr.cc
- holux.cc
html.cc
humminbird.cc
igc.cc
grtcirc.h
gtrnctr.h
heightgrid.h
- holux.h
humminbird.h
html.h
inifile.h
gtm
gtrnctr
height
- holux
humminbird
iblue747
igc
--- /dev/null
+/*
+ Access to holux wpo files.
+
+ Copyright (C) 2002 Jochen Becker, jb@bepo.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+History:
+ 2002-09-15 J. Becker start programming
+
+
+*/
+/* This module is for the holux (gm-100) .wpo format */
+
+#include <cstring> // for strncpy, memset, strcpy, strlen
+#include <cstdio> // for snprintf
+#include <ctime> // for gmtime, mktime, time_t, tm
+
+#include <QDate> // for QDate
+#include <QString> // for QString
+#include <QTime> // for QTime
+#include <QtGlobal> // for qRound
+
+#include "defs.h" // for Waypoint, le_write16, le_write32
+#include "holux.h"
+#include "gbfile.h" // for gbfclose, gbfopen_le, gbfile, gbfread
+#include "src/core/datetime.h" // for DateTime
+
+
+static gbfile* file_in;
+static gbfile* file_out;
+static unsigned char* HxWFile;
+static short_handle mkshort_handle;
+
+#define MYNAME "Holux"
+
+
+static void rd_init(const QString& fname)
+{
+ file_in = gbfopen_le(fname, "rb", MYNAME);
+}
+
+
+static void rd_deinit()
+{
+ gbfclose(file_in);
+}
+
+
+
+
+
+static void
+wr_init(const QString& fname)
+{
+ mkshort_handle = mkshort_new_handle();
+
+ HxWFile = (unsigned char*) xcalloc(GM100_WPO_FILE_SIZE, 1);
+
+ file_out = gbfopen_le(fname, "wb", MYNAME);
+}
+
+
+
+
+
+static void wr_deinit()
+{
+ mkshort_del_handle(&mkshort_handle);
+ gbfclose(file_out);
+}
+
+
+
+static void data_read()
+{
+ char name[9];
+ char desc[90];
+ struct tm tm;
+ struct tm* ptm;
+
+ memset(&tm, 0, sizeof(tm));
+
+ auto* HxWpt = (unsigned char*) xcalloc(GM100_WPO_FILE_SIZE, 1);
+
+ /* read the wpo file to the data-array */
+ int iDataRead = gbfread(HxWpt, 1, GM100_WPO_FILE_SIZE, file_in);
+
+ if (iDataRead == 0) {
+ fatal(MYNAME ": Error reading data from %s.\n", file_in->name);
+ }
+
+ int iWptNum = le_read16(&((WPTHDR*)HxWpt)->num);
+
+ /* Get the waypoints */
+ for (int iCount = 0; iCount < iWptNum ; iCount ++) {
+ auto* wpt_tmp = new Waypoint;
+
+ int iWptIndex = le_read16(&((WPTHDR*)HxWpt)->idx[iCount]);
+ WPT* pWptHxTmp = (WPT*)&HxWpt[OFFS_WPT + (sizeof(WPT) * iWptIndex)];
+
+ wpt_tmp->altitude = 0;
+ strncpy(name,pWptHxTmp->name,sizeof(name));
+ name[sizeof(pWptHxTmp->name)]=0;
+
+ strncpy(desc,pWptHxTmp->comment,sizeof(desc));
+ desc[sizeof(pWptHxTmp->comment)]=0;
+
+ wpt_tmp->shortname = name;
+ wpt_tmp->description = desc;
+
+ wpt_tmp->SetCreationTime(0);
+ if (pWptHxTmp->date.year) {
+#if 0
+ /* Unless there's some endian swapping that I don't see,
+ * this can't be right. Then again, the definition of the
+ * the structure itself has a pretty serious disregard for
+ * host word size issues... - rjl
+ */
+ ptm = gmtime((time_t*)&pWptHxTmp->time);
+#else
+ time_t wt = le_read32(&pWptHxTmp->time);
+ ptm = gmtime(&wt);
+#endif
+ tm.tm_hour = ptm->tm_hour;
+ tm.tm_min = ptm->tm_min;
+ tm.tm_sec = ptm->tm_sec;
+
+ tm.tm_mday = pWptHxTmp->date.day;
+ tm.tm_mon = pWptHxTmp->date.month - 1;
+ tm.tm_year = pWptHxTmp->date.year - 1900;
+ wpt_tmp->SetCreationTime(mktime(&tm));
+ }
+
+ double lon = le_read32(&pWptHxTmp->pt.iLongitude) / 36000.0;
+ double lat = (le_read32(&pWptHxTmp->pt.iLatitude) / 36000.0) * -1.0;
+ wpt_tmp->longitude = lon;
+ wpt_tmp->latitude = lat;
+ waypt_add(wpt_tmp);
+ }
+ xfree(HxWpt);
+}
+
+
+
+
+static const char* mknshort(const char* stIn,unsigned int sLen)
+{
+ constexpr int MAX_STRINGLEN = 255;
+ static char strOut[MAX_STRINGLEN];
+ char strTmp[MAX_STRINGLEN];
+
+ if (sLen > MAX_STRINGLEN) {
+ return (stIn);
+ }
+
+ if (stIn == nullptr) {
+ return nullptr;
+ }
+
+ setshort_length(mkshort_handle, sLen);
+ setshort_mustuniq(mkshort_handle, 0);
+ setshort_defname(mkshort_handle, "");
+
+ char* shortstr = mkshort(mkshort_handle, stIn, false);
+ strcpy(strTmp,shortstr);
+ xfree(shortstr);
+
+ memset(strOut,' ', MAX_STRINGLEN);
+ strncpy(strOut,strTmp,strlen(strTmp));
+ return (strOut);
+}
+
+
+
+
+static void holux_disp(const Waypoint* wpt)
+{
+ double lon = wpt->longitude * 36000.0;
+ double lat = wpt->latitude * -36000.0;
+
+ short sIndex = le_read16(&((WPTHDR*)HxWFile)->num);
+
+ if (sIndex >= MAXWPT) {
+ fatal(MYNAME ": too many waypoints. Max is %d.\n", MAXWPT);
+ }
+
+ ((WPTHDR*)HxWFile)->idx[sIndex] = sIndex; /* set the waypoint index */
+ le_write16(&((WPTHDR*)HxWFile)->idx[sIndex], sIndex); /* set the waypoint index */
+ ((WPTHDR*)HxWFile)->used[sIndex] = 0xff; /* Waypoint used */
+
+
+ /* set Waypoint */
+ WPT* pWptHxTmp = (WPT*)&HxWFile[OFFS_WPT + (sizeof(WPT) * sIndex)];
+
+ memset(pWptHxTmp->name,0x20,sizeof(pWptHxTmp->name));
+ if (wpt->shortname != nullptr) {
+ strncpy(pWptHxTmp->name, mknshort(CSTRc(wpt->shortname),sizeof(pWptHxTmp->name)),sizeof(pWptHxTmp->name));
+ } else {
+ snprintf(pWptHxTmp->name,sizeof(pWptHxTmp->name), "W%d",sIndex);
+ }
+
+ memset(pWptHxTmp->comment,0x20,sizeof(pWptHxTmp->comment));
+ if (wpt->description != nullptr) {
+ strncpy(pWptHxTmp->comment, mknshort(CSTRc(wpt->description),sizeof(pWptHxTmp->comment)),sizeof(pWptHxTmp->comment));
+ }
+
+ /*set the time */
+ if (wpt->creation_time.isValid()) {
+ /* tm = gmtime(&wpt->creation_time);*/ /* I get the wrong result with gmtime ??? */
+ QDate date(wpt->GetCreationTime().date());
+ QTime time(wpt->GetCreationTime().time());
+ pWptHxTmp->time = (time.hour() * 3600) + (time.minute()* 60) + time.second();
+ pWptHxTmp->date.day = date.day();
+ pWptHxTmp->date.month = date.month();
+ pWptHxTmp->date.year = date.year();
+ } else {
+ pWptHxTmp->time = 0;
+ pWptHxTmp->date.day = 0;
+ pWptHxTmp->date.month = 0;
+ pWptHxTmp->date.year = 0;
+ }
+
+
+ // Note that conversions from double values to unsigned int
+ // yield undefined results for negative values.
+ // We intentionally convert to int, then do an implicit
+ // conversion to unsigned in the call.
+ le_write32(&pWptHxTmp->pt.iLatitude, qRound(lat));
+ le_write32(&pWptHxTmp->pt.iLongitude, qRound(lon));
+ pWptHxTmp->checked = 01;
+ pWptHxTmp->vocidx = (short)0xffff;
+ le_write16(&((WPTHDR*)HxWFile)->num, ++sIndex);
+ le_write16(&((WPTHDR*)HxWFile)->next, ++sIndex);
+}
+
+
+
+
+
+
+static void data_write()
+{
+ short sCount;
+
+ /* init the waypoint area*/
+ le_write32(&((WPTHDR*)HxWFile)->id, WPT_HDR_ID);
+ ((WPTHDR*)HxWFile)->num = 0;
+ ((WPTHDR*)HxWFile)->next = 0;
+
+ /* clear index list */
+ for (sCount = 0; sCount < MAXWPT; sCount++) {
+ ((WPTHDR*)HxWFile)->idx[sCount] = (signed short)-1;
+ }
+ for (sCount = 0; sCount < MAXWPT; sCount++) {
+ ((WPTHDR*)HxWFile)->used[sCount] = 0;
+ }
+
+ /* init the route area */
+ le_write32(&((RTEHDR*)&HxWFile[ROUTESTART])->id, RTE_HDR_ID);
+ ((RTEHDR*)&HxWFile[ROUTESTART])->num = 0;
+ le_write16(&((RTEHDR*)&HxWFile[ROUTESTART])->next, 1);
+ ((RTEHDR*)&HxWFile[ROUTESTART])->rteno = (signed short)-1;
+
+ /* clear index list */
+ for (sCount = 0; sCount < MAXRTE; sCount++) {
+ ((RTEHDR*)&HxWFile[ROUTESTART])->idx[sCount] = (signed short)-1;
+ }
+ for (sCount = 0; sCount < MAXRTE; sCount++) {
+ ((RTEHDR*)&HxWFile[ROUTESTART])->used[sCount] = 0;
+ }
+
+ waypt_disp_all(holux_disp);
+
+ int iWritten = gbfwrite(HxWFile, 1, GM100_WPO_FILE_SIZE,file_out);
+ if (iWritten == 0) {
+ fatal(MYNAME ": Error writing data to %s.\n", file_out->name);
+ }
+ xfree(HxWFile);
+}
+
+
+
+
+ff_vecs_t holux_vecs = {
+ ff_type_file,
+ FF_CAP_RW_WPT,
+ rd_init,
+ wr_init,
+ rd_deinit,
+ wr_deinit,
+ data_read,
+ data_write,
+ nullptr,
+ nullptr,
+ NULL_POS_OPS
+};
--- /dev/null
+/*
+ holux.h
+ Copyright (C) 2002 Jochen Becker, jb@bepo.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+
+/* header file for the holux gm-100 wpo format */
+
+#ifndef BYTE
+#define BYTE unsigned char
+#endif
+
+#ifndef WORD
+#define WORD unsigned short
+#endif
+
+#ifndef DWORD
+#define DWORD unsigned int
+#endif
+
+
+/* #define GM100_WPO_FILE_SIZE 25512 */ /* size of a holux gm-100 wpo file used by mapShow 1.4*/
+#define GM100_WPO_FILE_SIZE 25600 /* size of a holux gm-100 wpo file used by the GM-100*/
+
+#define ROUTESTART 23600 /* Offset for start of route */
+#define MAXWPT 500 /* max number of waypoint */
+#define MAXRTE 20 /* max number of routes */
+#define MAXWPTINRTE 30
+
+#define WPT_HDR_ID 0x5C38A631 /* waypoint header */
+#define RTE_HDR_ID 0xD87F59F0 /* route header */
+
+
+/* Offsets */
+#define OFFS_WPT 0x05E4 /* offet for waypoint table */
+
+
+struct WPTHDR {
+ DWORD id; /* WPT_HDR_ID */
+ short num; /* Current wpt number */
+ short next; /* next wpt number */
+ short idx[MAXWPT]; /* saving wpt index here for each wpt, default was -1*/
+ BYTE used[MAXWPT]; /* Have the match wpt been used (0xFF), Default was 0 */
+};
+
+
+
+
+struct POINT {
+ signed int iLongitude;
+ signed int iLatitude;
+};
+
+
+
+
+struct HX_DATE {
+ BYTE day;
+ BYTE month;
+ short year;
+};
+
+
+struct WPT {
+ char name[8]; /* wpt name */
+ char comment[12]; /* comment string */
+ POINT pt; /* waypoint location */
+ short vocidx; /* voice index, not used */
+ short usecount; /* counter: times used by routes */
+ HX_DATE date; /* date */
+ unsigned time; /* time */
+ char checked; /* Active or not */
+ BYTE dummy[3]; /* fill bytes */
+};
+
+
+
+struct RTEHDR {
+ DWORD id; /* RTE_HDR_ID */
+ short num; /* Current route number */
+ short next; /* next route number */
+ signed short idx[MAXRTE]; /* saving route index here for each route, default was -1 */
+ BYTE used[MAXRTE]; /* Have the wpt been used (0xFF), Default was 0 */
+ signed short rteno; /* Saving navigationroute number here */
+};
+
+
+struct RTE {
+ char name[8]; /* route name */
+ char comment[12]; /* comment string */
+ short wptnum; /* the total waypoint number */
+ short wptidx[MAXWPTINRTE]; /* the waypoint index in this route */
+ short reserved;
+ int date; /* date */
+ int time; /* time */
+};
+
+++ /dev/null
-/*
- Access to holux wpo files.
-
- Copyright (C) 2002 Jochen Becker, jb@bepo.com
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-History:
- 2002-09-15 J. Becker start programming
-
-
-*/
-/* This module is for the holux (gm-100) .wpo format */
-
-#include <cstring> // for strncpy, memset, strcpy, strlen
-#include <cstdio> // for snprintf
-#include <ctime> // for gmtime, mktime, time_t, tm
-
-#include <QDate> // for QDate
-#include <QString> // for QString
-#include <QTime> // for QTime
-#include <QtGlobal> // for qRound
-
-#include "defs.h" // for Waypoint, le_write16, le_write32
-#include "holux.h"
-#include "gbfile.h" // for gbfclose, gbfopen_le, gbfile, gbfread
-#include "src/core/datetime.h" // for DateTime
-
-
-static gbfile* file_in;
-static gbfile* file_out;
-static unsigned char* HxWFile;
-static short_handle mkshort_handle;
-
-#define MYNAME "Holux"
-
-
-static void rd_init(const QString& fname)
-{
- file_in = gbfopen_le(fname, "rb", MYNAME);
-}
-
-
-static void rd_deinit()
-{
- gbfclose(file_in);
-}
-
-
-
-
-
-static void
-wr_init(const QString& fname)
-{
- mkshort_handle = mkshort_new_handle();
-
- HxWFile = (unsigned char*) xcalloc(GM100_WPO_FILE_SIZE, 1);
-
- file_out = gbfopen_le(fname, "wb", MYNAME);
-}
-
-
-
-
-
-static void wr_deinit()
-{
- mkshort_del_handle(&mkshort_handle);
- gbfclose(file_out);
-}
-
-
-
-static void data_read()
-{
- char name[9];
- char desc[90];
- struct tm tm;
- struct tm* ptm;
-
- memset(&tm, 0, sizeof(tm));
-
- auto* HxWpt = (unsigned char*) xcalloc(GM100_WPO_FILE_SIZE, 1);
-
- /* read the wpo file to the data-array */
- int iDataRead = gbfread(HxWpt, 1, GM100_WPO_FILE_SIZE, file_in);
-
- if (iDataRead == 0) {
- fatal(MYNAME ": Error reading data from %s.\n", file_in->name);
- }
-
- int iWptNum = le_read16(&((WPTHDR*)HxWpt)->num);
-
- /* Get the waypoints */
- for (int iCount = 0; iCount < iWptNum ; iCount ++) {
- auto* wpt_tmp = new Waypoint;
-
- int iWptIndex = le_read16(&((WPTHDR*)HxWpt)->idx[iCount]);
- WPT* pWptHxTmp = (WPT*)&HxWpt[OFFS_WPT + (sizeof(WPT) * iWptIndex)];
-
- wpt_tmp->altitude = 0;
- strncpy(name,pWptHxTmp->name,sizeof(name));
- name[sizeof(pWptHxTmp->name)]=0;
-
- strncpy(desc,pWptHxTmp->comment,sizeof(desc));
- desc[sizeof(pWptHxTmp->comment)]=0;
-
- wpt_tmp->shortname = name;
- wpt_tmp->description = desc;
-
- wpt_tmp->SetCreationTime(0);
- if (pWptHxTmp->date.year) {
-#if 0
- /* Unless there's some endian swapping that I don't see,
- * this can't be right. Then again, the definition of the
- * the structure itself has a pretty serious disregard for
- * host word size issues... - rjl
- */
- ptm = gmtime((time_t*)&pWptHxTmp->time);
-#else
- time_t wt = le_read32(&pWptHxTmp->time);
- ptm = gmtime(&wt);
-#endif
- tm.tm_hour = ptm->tm_hour;
- tm.tm_min = ptm->tm_min;
- tm.tm_sec = ptm->tm_sec;
-
- tm.tm_mday = pWptHxTmp->date.day;
- tm.tm_mon = pWptHxTmp->date.month - 1;
- tm.tm_year = pWptHxTmp->date.year - 1900;
- wpt_tmp->SetCreationTime(mktime(&tm));
- }
-
- double lon = le_read32(&pWptHxTmp->pt.iLongitude) / 36000.0;
- double lat = (le_read32(&pWptHxTmp->pt.iLatitude) / 36000.0) * -1.0;
- wpt_tmp->longitude = lon;
- wpt_tmp->latitude = lat;
- waypt_add(wpt_tmp);
- }
- xfree(HxWpt);
-}
-
-
-
-
-static const char* mknshort(const char* stIn,unsigned int sLen)
-{
- constexpr int MAX_STRINGLEN = 255;
- static char strOut[MAX_STRINGLEN];
- char strTmp[MAX_STRINGLEN];
-
- if (sLen > MAX_STRINGLEN) {
- return (stIn);
- }
-
- if (stIn == nullptr) {
- return nullptr;
- }
-
- setshort_length(mkshort_handle, sLen);
- setshort_mustuniq(mkshort_handle, 0);
- setshort_defname(mkshort_handle, "");
-
- char* shortstr = mkshort(mkshort_handle, stIn, false);
- strcpy(strTmp,shortstr);
- xfree(shortstr);
-
- memset(strOut,' ', MAX_STRINGLEN);
- strncpy(strOut,strTmp,strlen(strTmp));
- return (strOut);
-}
-
-
-
-
-static void holux_disp(const Waypoint* wpt)
-{
- double lon = wpt->longitude * 36000.0;
- double lat = wpt->latitude * -36000.0;
-
- short sIndex = le_read16(&((WPTHDR*)HxWFile)->num);
-
- if (sIndex >= MAXWPT) {
- fatal(MYNAME ": too many waypoints. Max is %d.\n", MAXWPT);
- }
-
- ((WPTHDR*)HxWFile)->idx[sIndex] = sIndex; /* set the waypoint index */
- le_write16(&((WPTHDR*)HxWFile)->idx[sIndex], sIndex); /* set the waypoint index */
- ((WPTHDR*)HxWFile)->used[sIndex] = 0xff; /* Waypoint used */
-
-
- /* set Waypoint */
- WPT* pWptHxTmp = (WPT*)&HxWFile[OFFS_WPT + (sizeof(WPT) * sIndex)];
-
- memset(pWptHxTmp->name,0x20,sizeof(pWptHxTmp->name));
- if (wpt->shortname != nullptr) {
- strncpy(pWptHxTmp->name, mknshort(CSTRc(wpt->shortname),sizeof(pWptHxTmp->name)),sizeof(pWptHxTmp->name));
- } else {
- snprintf(pWptHxTmp->name,sizeof(pWptHxTmp->name), "W%d",sIndex);
- }
-
- memset(pWptHxTmp->comment,0x20,sizeof(pWptHxTmp->comment));
- if (wpt->description != nullptr) {
- strncpy(pWptHxTmp->comment, mknshort(CSTRc(wpt->description),sizeof(pWptHxTmp->comment)),sizeof(pWptHxTmp->comment));
- }
-
- /*set the time */
- if (wpt->creation_time.isValid()) {
- /* tm = gmtime(&wpt->creation_time);*/ /* I get the wrong result with gmtime ??? */
- QDate date(wpt->GetCreationTime().date());
- QTime time(wpt->GetCreationTime().time());
- pWptHxTmp->time = (time.hour() * 3600) + (time.minute()* 60) + time.second();
- pWptHxTmp->date.day = date.day();
- pWptHxTmp->date.month = date.month();
- pWptHxTmp->date.year = date.year();
- } else {
- pWptHxTmp->time = 0;
- pWptHxTmp->date.day = 0;
- pWptHxTmp->date.month = 0;
- pWptHxTmp->date.year = 0;
- }
-
-
- // Note that conversions from double values to unsigned int
- // yield undefined results for negative values.
- // We intentionally convert to int, then do an implicit
- // conversion to unsigned in the call.
- le_write32(&pWptHxTmp->pt.iLatitude, qRound(lat));
- le_write32(&pWptHxTmp->pt.iLongitude, qRound(lon));
- pWptHxTmp->checked = 01;
- pWptHxTmp->vocidx = (short)0xffff;
- le_write16(&((WPTHDR*)HxWFile)->num, ++sIndex);
- le_write16(&((WPTHDR*)HxWFile)->next, ++sIndex);
-}
-
-
-
-
-
-
-static void data_write()
-{
- short sCount;
-
- /* init the waypoint area*/
- le_write32(&((WPTHDR*)HxWFile)->id, WPT_HDR_ID);
- ((WPTHDR*)HxWFile)->num = 0;
- ((WPTHDR*)HxWFile)->next = 0;
-
- /* clear index list */
- for (sCount = 0; sCount < MAXWPT; sCount++) {
- ((WPTHDR*)HxWFile)->idx[sCount] = (signed short)-1;
- }
- for (sCount = 0; sCount < MAXWPT; sCount++) {
- ((WPTHDR*)HxWFile)->used[sCount] = 0;
- }
-
- /* init the route area */
- le_write32(&((RTEHDR*)&HxWFile[ROUTESTART])->id, RTE_HDR_ID);
- ((RTEHDR*)&HxWFile[ROUTESTART])->num = 0;
- le_write16(&((RTEHDR*)&HxWFile[ROUTESTART])->next, 1);
- ((RTEHDR*)&HxWFile[ROUTESTART])->rteno = (signed short)-1;
-
- /* clear index list */
- for (sCount = 0; sCount < MAXRTE; sCount++) {
- ((RTEHDR*)&HxWFile[ROUTESTART])->idx[sCount] = (signed short)-1;
- }
- for (sCount = 0; sCount < MAXRTE; sCount++) {
- ((RTEHDR*)&HxWFile[ROUTESTART])->used[sCount] = 0;
- }
-
- waypt_disp_all(holux_disp);
-
- int iWritten = gbfwrite(HxWFile, 1, GM100_WPO_FILE_SIZE,file_out);
- if (iWritten == 0) {
- fatal(MYNAME ": Error writing data to %s.\n", file_out->name);
- }
- xfree(HxWFile);
-}
-
-
-
-
-ff_vecs_t holux_vecs = {
- ff_type_file,
- FF_CAP_RW_WPT,
- rd_init,
- wr_init,
- rd_deinit,
- wr_deinit,
- data_read,
- data_write,
- nullptr,
- nullptr,
- NULL_POS_OPS
-};
+++ /dev/null
-/*
- holux.h
- Copyright (C) 2002 Jochen Becker, jb@bepo.com
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-/* header file for the holux gm-100 wpo format */
-
-#ifndef BYTE
-#define BYTE unsigned char
-#endif
-
-#ifndef WORD
-#define WORD unsigned short
-#endif
-
-#ifndef DWORD
-#define DWORD unsigned int
-#endif
-
-
-/* #define GM100_WPO_FILE_SIZE 25512 */ /* size of a holux gm-100 wpo file used by mapShow 1.4*/
-#define GM100_WPO_FILE_SIZE 25600 /* size of a holux gm-100 wpo file used by the GM-100*/
-
-#define ROUTESTART 23600 /* Offset for start of route */
-#define MAXWPT 500 /* max number of waypoint */
-#define MAXRTE 20 /* max number of routes */
-#define MAXWPTINRTE 30
-
-#define WPT_HDR_ID 0x5C38A631 /* waypoint header */
-#define RTE_HDR_ID 0xD87F59F0 /* route header */
-
-
-/* Offsets */
-#define OFFS_WPT 0x05E4 /* offet for waypoint table */
-
-
-struct WPTHDR {
- DWORD id; /* WPT_HDR_ID */
- short num; /* Current wpt number */
- short next; /* next wpt number */
- short idx[MAXWPT]; /* saving wpt index here for each wpt, default was -1*/
- BYTE used[MAXWPT]; /* Have the match wpt been used (0xFF), Default was 0 */
-};
-
-
-
-
-struct POINT {
- signed int iLongitude;
- signed int iLatitude;
-};
-
-
-
-
-struct HX_DATE {
- BYTE day;
- BYTE month;
- short year;
-};
-
-
-struct WPT {
- char name[8]; /* wpt name */
- char comment[12]; /* comment string */
- POINT pt; /* waypoint location */
- short vocidx; /* voice index, not used */
- short usecount; /* counter: times used by routes */
- HX_DATE date; /* date */
- unsigned time; /* time */
- char checked; /* Active or not */
- BYTE dummy[3]; /* fill bytes */
-};
-
-
-
-struct RTEHDR {
- DWORD id; /* RTE_HDR_ID */
- short num; /* Current route number */
- short next; /* next route number */
- signed short idx[MAXRTE]; /* saving route index here for each route, default was -1 */
- BYTE used[MAXRTE]; /* Have the wpt been used (0xFF), Default was 0 */
- signed short rteno; /* Saving navigationroute number here */
-};
-
-
-struct RTE {
- char name[8]; /* route name */
- char comment[12]; /* comment string */
- short wptnum; /* the total waypoint number */
- short wptidx[MAXWPTINRTE]; /* the waypoint index in this route */
- short reserved;
- int date; /* date */
- int time; /* time */
-};
-
gpsdrive GpsDrive Format
gpsdrivetrack GpsDrive Format for Tracks
gpx gpx GPX XML
-holux wpo Holux (gm-100) .wpo Format
m241-bin bin Holux M-241 (MTK based) Binary File Format
m241 Holux M-241 (MTK based) download
html html HTML Output
file gpsdrive GpsDrive Format
file gpsdrivetrack GpsDrive Format for Tracks
file gpx gpx GPX XML
-file holux wpo Holux (gm-100) .wpo Format
file m241-bin bin Holux M-241 (MTK based) Binary File Format
serial m241 Holux M-241 (MTK based) download
file html html HTML Output
file rw---- gpsdrive GpsDrive Format
file rw---- gpsdrivetrack GpsDrive Format for Tracks
file rwrwrw gpx gpx GPX XML
-file rw---- holux wpo Holux (gm-100) .wpo Format
file r-r--- m241-bin bin Holux M-241 (MTK based) Binary File Format
serial --r--- m241 Holux M-241 (MTK based) download
file -w---- html html HTML Output
option gpx elevprec Precision of elevations, number of decimals integer 3 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_gpx.html#fmt_gpx_o_elevprec
-file rw---- holux wpo Holux (gm-100) .wpo Format holux
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_holux.html
file r-r--- m241-bin bin Holux M-241 (MTK based) Binary File Format m241-bin
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_m241-bin.html
option m241-bin csv MTK compatible CSV output file string https://www.gpsbabel.org/WEB_DOC_DIR/fmt_m241-bin.html#fmt_m241-bin_o_csv
humminbirdextensio (0/1) Add info (depth) as Humminbird extension
garminextensions (0/1) Add info (depth) as Garmin extension
elevprec Precision of elevations, number of decimals
- holux Holux (gm-100) .wpo Format
m241-bin Holux M-241 (MTK based) Binary File Format
csv MTK compatible CSV output file
m241 Holux M-241 (MTK based) download
+++ /dev/null
-
-# Holux support is a little funky to test. Becuase it loses precision,
-# if we convert it to another format, we lose accuracy (rounding) in the
-# coords, so converting it so something else and comparing it never works.
-# So we verify that we can read the reference and write it and get an
-# identical reference.
-gpsbabel -i holux -f ${REFERENCE}/paris.wpo -o holux -F ${TMPDIR}/paris.wpo
-bincompare ${REFERENCE}/paris.wpo ${TMPDIR}/paris.wpo
extern ff_vecs_t garmin_vecs;
extern ff_vecs_t ozi_vecs;
#if MAXIMAL_ENABLED
-extern ff_vecs_t holux_vecs;
extern ff_vecs_t tpg_vecs;
extern ff_vecs_t tpo2_vecs;
extern ff_vecs_t tpo3_vecs;
KmlFormat kml_fmt;
#if MAXIMAL_ENABLED
LowranceusrFormat lowranceusr_fmt;
- LegacyFormat holux_fmt {holux_vecs};
LegacyFormat tpg_fmt {tpg_vecs};
LegacyFormat tpo2_fmt {tpo2_vecs};
LegacyFormat tpo3_fmt {tpo3_vecs};
"usr",
nullptr,
},
- {
- &holux_fmt,
- "holux",
- "Holux (gm-100) .wpo Format",
- "wpo",
- nullptr,
- },
{
&tpg_fmt,
"tpg",
+++ /dev/null
-
-
-
- <para> The Holux gm-100 (e-fox) gps receiver uses standard
-compact flash cards. File formats were provided by Holux-Taiwan
-<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.holux.com.tw">holux.com</link> to the author.
-The code was tested against version 2.27E1; other versions and
-receivers may work but have not been explicitly tested. Anyone with
-information on other Holux receivers is encouraged to contact
-jochen@bauerbahn.net.
-</para>
- <para> When copying the .wpo file to a flash card, the file must
-be named <filename>tempwprt.wpo</filename> as the
-receiver will ignore all other files.
-</para>
- <para> Comparing the waypoints of a .wpo files against other
-formats like .gpx you may notice a small difference in the latitude
-and longitude values. The reason is the low resolution of the
-coordinates in the wpo file format. In a .wpo file the resolution is
-1/10"; in gpx for example it is 1/100". A a practical matter, this
-loss is only about 1.7 meters (5 feet).
-</para>
- <para> The generated waypoint files can also be used by MapShow
-version 1.14. This program is free of charge from the Holux web site.
-</para>
- <para> This format was contributed by Jochen Becker.
-</para>